﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;

namespace SlamCms.SharePoint.Core.Extensions
{

    public static class SPFileExtensions
    {
        public static bool CheckOutFileStatus(this SPFile file)
        {
            return !(file.CheckOutType == SPFile.SPCheckOutType.None);
        }

        public static void CheckOutForced(this SPFile file)
        {
            if (!(file.CheckOutType == SPFile.SPCheckOutType.None))
            {
                file.UndoCheckOut();
            }

            file.CheckOut();
        }
    }
}
